package com.itfreer.ui.base.validations;

import java.util.HashMap;
import java.util.Map;

/**
 * 验证注册器
 */
public class ValidationRegister {

    /**
     * 验证注册器
     */
    private static Map<String, ValidationExecutor> alidationMap = new HashMap<String, ValidationExecutor>();

    static {
        alidationMap.put("UserNameValidation", new UserNameValidation());
        alidationMap.put("PasswordValidation", new PasswordValidation());
    }

    public static ValidationExecutor getValidationExecutor(String name){
        if(alidationMap.containsKey(name)){
            return alidationMap.get(name);
        } else {
            return null;
        }
    }

    public static void setValidationExecutor(String name, ValidationExecutor value){
        alidationMap.put(name, value);
    }
}